<include file="Public/head" />
<body>
<form action="?" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 商家列表</strong></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <li> <a class="button border-main icon-plus-square-o" href="{:U('index/info')}"> 添加商家</a> </li>
        <li>搜索商家：</li>
        <li>
            <input type="text" placeholder="请输入搜索关键字" name="company_name" value="{$get['company_name']}" class="input" style="width:250px; line-height:17px;display:inline-block" />
            <input type="submit" value="搜索" class="button border-main icon-search"/>
        </li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="100" style="text-align:left; padding-left:20px;">ID</th>
        <th>logo图片</th>
        <th>名称</th>
        <th>帐号</th>
        <th>手机号</th>
        <!--<th>套餐</th>-->
        <th width="10%">有效期</th>
        <th>状态</th>
        <th width="310">操作</th>
      </tr>
      <foreach name="list" item="v">
        <tr>
          <td style="text-align:left; padding-left:20px;">{$v['c_id']}</td>
          <td width="10%"><img src="__ROOT__/{$v['company_logo']}" alt="" width="60" height="60" /></td>
          <td>{$v['company_name']}</td>
          <td>{$v['account_name']}</td>
          <td>{$v['tel']}</td>
          <!--<td>{$v['package_name']}</td>-->
          <td>{$v['expire_time']|date="Y-m-d H:i",###}</td>
            <td><span class="sp01" onclick="is_stauts({$v['status']},this)">
            <if condition="$v['status'] == 1">
                <img src="__PUBLIC__/web/images/yes.png" width="18px;"alt="">
                <else />
                <img src="__PUBLIC__/web/images/no.png" width="18px;"alt="">
            </if>
          </span></td>
          <td>
              <div class="button-group">
                  <a class="button border-main" href="{:U('index/info',array('id'=>$v['c_id']))}"><span class="icon-edit"></span> 修改</a>
              </div>
          </td>
        </tr>
      </foreach>
      <tr>
        <td colspan="10"><div class="pagelist">{$page}</div></td>
      </tr>
    </table>
  </div>
</form>
<script type="text/javascript">
//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
		
	}
}

function is_stauts(id,t){
    var url = "{:U('index/is_status')}";
    $.getJSON(url,{id:id},function (data){
        if(data.result == 'yes'){
            $(t).find('img').attr('src',"__PUBLIC__/web/images/yes.png");
        }else if(data.result == 'no'){
            $(t).find('img').attr('src',"__PUBLIC__/web/images/no.png");
        }
    })
}

</script>
</body>
</html>